import { request, excelRequest } from "./request";
let that = this;

export function channelCommit(params) {
  // 通道提交
  return request({
    url: `/product/v31/api/merchant/channel/commit`,
    method: "post",
    params, 
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function reportQuery(params) {
  // 银联进件审核查询
  return request({
    url: `/product/v31/api/merchant/reportQuery`,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function reviewedQuery(params) {
  // 星义付进件审核查询
  return request({
    url: `/product/v31/api/merchant/reviewedQuery`,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}


// anxinSignPerson
export function anxinSignPerson(params) {
  // 安心签个人版开户发送验证码
  return request({
    url: `/product/v31/api/merchant/anxinSignPerson`,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function anxinSignCompany(params) {
  // 企业和个体安心签开户发送验证码
  return request({
    url: `/product/v31/api/merchant/anxinSignCompany`,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function dGetChannelList(params) {
  // 查询绑定进件信息
  return request({
    url: `/product/v31/api/merchant/getChannelList`,
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function querySaveMerchant(params) {
  // 查询绑定进件信息
  return request({
    url: `/product/v31/api/merchant/querySaveMerchant`,
    method: "POST",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function queryAgentProfitByChannel(params) {
  // 查询业务经理最低费率
  return request({
    url: `/product/v31/api/merchant/queryAgentProfitByChannel`,
    method: "POST",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}



export function singleChannelModify(data) {
  // 修改商户信息
  return request({
    url: `/product/v31/api/merchant/singleChannelModify`,
    method: "POST",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function merchantGet(id) {
  // /v5/sbapi/merchant/get/{id}
  // 查询进件商户详情
  return request({
    url: `/product/v31/api/merchant/get/${id}`,
    method: "GET",
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function queryStatusMerchant(data) {
  // 查询正在进件的商户
  return request({
    url: "/product/v31/api/merchant/queryStatusMerchant",
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function AbankInfoList(data) {
  // 获取汇付银行总行列表
  return request({
    url: "/yfpay/api/info/bank",
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
// 汇付小微进件
export function singleChannelSave(data) {
  return request({
    url: `/product/v31/api/merchant/singleChannelSave`,
    method: "POST",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    }
  });
}
// 查询所属行业（mcc）
export function getTopMccByType(data) {
  return request({
    url: "/product/v31/api/merchant/getTopMccByType",
    method: "POST",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    }
  });
}

// app编辑
export function versionUpdate(params) {
  return request({
    url: "/product/v31/api/version/update/"+params.id,
    method: "put",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    }
  });
}

// app新增
export function versionSave(params) {
  return request({
    url: "/product/v31/api/version/save",
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    }
  });
}

// app列表
export function versionPage(params) {
  return request({
    url: "/product/v31/api/version/page",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    }
  });
}

// 查询银行或者支行
export function bankInfolists(data) {
  return request({
    url: "/yfpay/api/info/bank",
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    }
  });
}

// 查询银行或者支行
export function bankInfolist(data) {
  return request({
    url: "/yfpay/api/info/getBank",
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    }
  });
}
// 提交表单字段信息
export function addFieldInfo(data) {
  return request({
    url: "/product/v31/api/system/configCategory/addFieldInfo",
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    }
  });
}
// 获取分类配置详情
export function getTreeFieldInfo(id) {
  return request({
    url: "/product/v31/api/system/configCategory/getTreeFieldInfo/"+id,
    method: "post",
    headers: {
      token: sessionStorage.getItem("token"),
    }
  });
}
// 配置表单
export function configForms(data) {
  return request({
    url: "/product/v31/api/system/configCategory/configForm",
    method: "post",
    headers: {
      token: sessionStorage.getItem("token"),
    },
    data
  });
}

// 编辑分类
export function configCategoryEdit(data) {
  return request({
    url: "/product/v31/api/system/configCategory/edit",
    method: "post",
    headers: {
      token: sessionStorage.getItem("token"),
    },
    data
  });
}
// 查询分类
export function configCategoryGet(data) {
  return request({
    url: "/product/v31/api/system/configCategory/getTree?type="+data.type,
    method: "post",
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

// 新增分类
export function configCategoryAdd(data) {
  // 构建小程序版本
  return request({
    url: "/product/v31/api/system/configCategory/add",
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}


export function getAreaList() {
  // 构建小程序版本
  return request({
    url: "/payment/merchants/getArea",
    method: "post",
  });
}


export function constructUpload(data) {
  // 构建小程序版本
  return request({
    url: "/payment/construct/upload",
    method: "post",
    data,
  });
}

export function updatepassword(data) {
  // 忘记密码
  return request({
    url: "/product/v3/sbapi/users/update/password",
    method: "post",
    data,
  });
}

export function sms(params) {
  //获取验证码
  return request({
    url: "/product/v3/api/user/sms",
    method: "get",
    params,
  });
}
export function getBindPhone(params) {
  //获取手机号
  return request({
    url: "/product/v3/sbapi/users/getBindPhone",
    method: "get",
    params,
  });
}
export function getservice(params) {
  //服务商级别
  return request({
    url: "/product/v31/api/agent/list",
    method: "get",
    params,
    // headers: {"Content-Type":'application/json'}
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getBD(params) {
  return request({
    url: "/product/v31/api/bd/list",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function arealist(data) {
  // 获取省市区列表
  return request({
    url: "/product/v31/area/list",
    method: "post",
    data,
  });
}
export function mcclist(data) {
  // 获取行业类目列表
  return request({
    url: "/product/v31/mcc/list",
    method: "post",
    data,
  });
}
export function wx1(params) {
  //行业一级 废除）
  return request({
    url: "/product/v3/sbapi/mcc/wx1/list",
    method: "get",
    params,
    // headers: {"Content-Type":'application/json'}
  });
}
export function getChannelList(params) {
  //我的商户 获取通道类型
  return request({
    url: "/product/v31/api/channel/getChannelList",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function merchantlist(params) {
  //商户列表分页
  return request({
    url: "/product/v31/api/merchant/page",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function allmerchantlist(params) {
  //获取总店列表
  return request({
    url: "/product/v31/api/merchant/list",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function merchantall(params) {
  //全部商户
  return request({
    url: "/product/v31/api/merchant/list",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function blockup(params, id) {
  //停用商户
  return request({
    url: "/product/v31/api/merchant/delete/" + id,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function merchantremove(params, id) {
  //注销商户
  return request({
    url: "/product/v31/api/merchant/remove/" + id,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function getActiveCount(params) {
  //动销商户列表
  return request({
    url: "/product/v31/api/merchant/getActiveCount",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function login(params) {
  //登录
  return request({
    url: "/product/v31/api/user/login",
    method: "post",
    params,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
  });
}
export function testLogin(params) {
  //测试登录
  return request({
    url: "/api/product/v31/api/user/login",
    method: "post",
    params,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
  });
}

export function shop(params) {
  //门店列表
  return request({
    url: "/product/v31/api/merchant/shop/page",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function merchantdetails(params, no) {
  //商户详情
  return request({
    url: "/product/v31/api/merchant/get/" + no,
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function channel(params) {
  //商户通道
  return request({
    url: "/product/v31/api/merchant/channel/list",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function addshop(params) {
  //增加门店
  return request({
    url: "/product/v31/api/merchant/shop/open/save",
    method: "post",
    params,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function shopupdate(params, id) {
  //修改门店
  return request({
    url: "/product/v31/api/merchant/shop/open/update/" + id,
    method: "put",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function shopFuncUpdate(params) {
  // 门店功能配置
  return request({
    url: "/product/v31/api/merchant/shop/updateTradeSwitch",
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function shopenable(data, id) {
  //启用门店
  return request({
    url: "/product/v31/api/merchant/shop/enable/" + id,
    method: "post",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
      token: sessionStorage.getItem("token"),
    },
  });
}

export function getTotalShopCount(params) {
  //总门店数
  return request({
    url: "/product/v31/api/merchant/shop/getTotalShopCount",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function getMerchantShop(params, id) {
  //门店信息
  return request({
    url: "/product/v31/api/merchant/shop/get/" + id,
    method: "get",
    params,
    headers: { token: sessionStorage.getItem("token") },
  });
}

export function channellist(params) {
  //通道列表
  return request({
    url: "/product/v31/api/inst/page",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function agent(params) {
  //服务商列表
  return request({
    url: "/product/v31/api/agent/page",
    // url: "http://192.168.5.172/product/v31/api/agent/page",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function addchannel(params) {
  //新增渠道
  return request({
    url: "/product/v31/api/inst/save",
    // url: "http://192.168.5.172/product/v31/api/inst/save",
    method: "post",
    params,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function channelupdate(params, id) {
  //修改渠道
  return request({
    url: "/product/v3/sbapi/inst/update/" + id,
    method: "put",
    params,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
      token: sessionStorage.getItem("token"),
    },
  });
}

export function getSelect(params) {
  //角色机构类型查询
  return request({
    url: "/product/v31/api/inst/getSelect",
    method: "get",
    params,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function menulist(params) {
  //系统菜单
  return request({
    url: "/product/v31/api/menu/list",
    method: "get",
    params,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
      token: sessionStorage.getItem("token"),
    },
  });
}

export function getNodeMenu(params) {
  //系统菜单
  return request({
    url: "/product/v31/api/menu/getNodeMenu",
    method: "get",
    params,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function menuysave(params) {
  //新建系统菜单
  return request({
    url: "/product/v31/api/menu/save",
    method: "POST",
    params,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function meundelete(params, id) {
  //删除统菜单
  return request({
    url: "/product/v31/api/menu/delete/" + id,
    method: "POST",
    params,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function meunenable(params, id) {
  //删除统菜单
  return request({
    url: "/product/v31/api/menu/enable/" + id,
    method: "POST",
    params,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getAllMenu(params) {
  //更新菜单
  return request({
    url: "/product/v31/api/menu/getAllMenu",
    method: "get",
    params,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function roleslist(params) {
  //角色列表
  return request({
    url: "/product/v31/api/roles/list",
    method: "get",
    params,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getOwnedMenu(params) {
  //角色权限列表
  return request({
    url: "/product/v31/api/roles/getOwnedMenu",
    method: "get",
    params,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function APIgetUserMenu(params) {
  //配置角色权限列表
  return request({
    url: "/product/v31/api/roles/getUserMenu",
    method: "get",
    params,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function APIgetUserMenuIsEnable(params) {
  //禁用角色权限列表
  return request({
    url: "/product/v31/api/roles/getUserMenuIsEnable",
    method: "get",
    params,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function updateRoleMenu(params) {
  //修改角色权限
  return request({
    url: "/product/v31/api/roles/updateRoleMenu",
    method: "POST",
    params,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function APIPermissionConfiguration(params) {
  //修改角色权限
  return request({
    url: "/product/v31/api/roles/updateUserMenu",
    method: "POST",
    params,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function APIupdateUserMenuIsEnable(params) {
  //修改角色权限
  return request({
    url: "/product/v31/api/roles/updateUserMenuIsEnable",
    method: "POST",
    params,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function shopdelete(params, id) {
  //注销门店
  return request({
    url: "/product/v31/api/merchant/shop/remove/" + id,
    method: "POST",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getAccountList(params) {
  //用户 账号管理 获取列表数据
  return request({
    url: "/product/v31/api/user/page",
    // url:'http://192.168.5.172/product/v31/api/user/page',
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getUserTypes(params) {
  //用户 账号管理 获取所有用户类型
  return request({
    url: "/product/v31/api/user/getQueryRoles",
    // url: "http://192.168.5.172/product/v31/api/user/getQueryRoles",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getAddUserTypes(params) {
  //用户 账号管理 新增账号获取所有用户类型
  return request({
    url: "/product/v31/api/user/getCreateRoles",
    // url: "http://192.168.5.172/product/v31/api/user/getCreateRoles",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function addAccount(params) {
  //用户 账号管理 新增账号
  return request({
    url: "/product/v31/api/user/save",
    // url:'http://192.168.5.172/product/v31/api/user/save',
    method: "POST",
    params,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function updateUser(params) {
  //用户 账号管理 修改账户信息
  return request({
    url: "/product/v31/api/user/update",
    // url:'http://192.168.5.172/product/v31/api/user/update',
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function disableUser(params, id) {
  //用户 账号管理 停用账号
  return request({
    url: "/product/v31/api/user/disable/" + id,
    // url:'http://192.168.5.172/product/v31/api/user/disable/'+ id,
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function postuserdelete(params, id) {
  //用户 账号管理 启用账号
  return request({
    url: "/product/v31/api/user/delete/" + id,
    // url:'http://192.168.5.172/product/v31/api/user/enable/'+ id,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function enableUser(params, id) {
  //用户 账号管理 删除账号
  return request({
    url: "/product/v31/api/user/enable/" + id,
    // url:'http://192.168.5.172/product/v31/api/user/enable/'+ id,
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function resetPassword(params, id) {
  //用户 账号管理 重置密码
  return request({
    url: "/product/v31/api/user/resetPassword/" + id,
    // url:'http://192.168.5.172/product/v31/api/user/resetPassword/'+ id,
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getUserSelect(params) {
  //用户 账号管理 新增账号 模糊查询
  return request({
    url: "/product/v31/api/inst/getSelect",
    // url:'http://192.168.5.172/product/v31/api/inst/getSelect',
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getStoreList(params) {
  //用户 账号管理 新增账号 获取门店列表
  return request({
    url: "/product/v31/api/merchant/shop/list",
    // url:'http://192.168.5.172/product/v31/api/merchant/shop/list',
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function postUserList(params) {
  //用户 账号管理 新增账号
  return request({
    url: "/product/v31/api/user/save",
    // url:'http://192.168.5.172/product/v31/api/user/save',
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function channelget(params, id) {
  // 获取支付配置
  return request({
    url: "/product/v31/api/merchant/channel/get/" + id,
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function updatewx(params, id) {
  // 修改微信支付配置
  return request({
    url: "/product/v31/api/merchant/channel/update/wx/" + id,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function updateali(data, id) {
  // 修改微信支付配置
  return request({
    url: "/product/v31/api/merchant/channel/update/alipay/" + id,
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function ratelist(params) {
  // 费率列表
  return request({
    url: "/product/v31/api/merchant/rate/list",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function updaterate(params, id) {
  // 修改微信费率
  return request({
    url: "/product/v31/api/merchant/channel/wx/update/rate/" + id,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function aliupdaterate(params, id) {
  // 修改支付宝费率
  return request({
    url: "/product/v31/api/merchant/channel/ali/update/rate/" + id,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function uniupdaterate(params, id) {
  // 修改云闪付费率
  return request({
    url: "/product/v31/api/merchant/channel/uni/update/rate/" + id,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function bestpayupdaterate(params, id) {
  // 修改翼支付费率
  return request({
    url: "/product/v31/api/merchant/channel/bestpay/update/rate/" + id,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function ecnyupdaterate(params, id) {
  // 修改数字人民币费率
  return request({
    url: "/product/v31/api/merchant/channel/ecny/update/rate/" + id,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function longpayupdaterate(params, id) {
  // 修改龙支付费率
  return request({
    url: "/product/v31/api/merchant/channel/longpay/update/rate/" + id,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function deleteAgency(params, id) {
  //机构管理  删除机构
  return request({
    url: "/product/v31/api/inst/delete/" + id,
    // url:'http://192.168.5.172/product/v31/api/inst/delete/'+id,
    method: "put",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function updateAgency(params, id) {
  //机构管理  修改提交
  return request({
    url: "/product/v31/api/inst/update/" + id,
    // url:'http://192.168.5.172/product/v31/api/inst/update/'+id,
    method: "put",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getServiceData(params, id) {
  //服务商  详情页获取数据
  return request({
    url: "/product/v31/api/agent/get/" + id,
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function deleteServiceProviders(params, id) {
  //服务商  删除服务商
  return request({
    url: "/product/v31/api/agent/delete/" + id,
    method: "put",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getLastService(params) {
  //服务商 新增弹框 获取一级服务商
  return request({
    url: "/product/v31/api/agent/list/",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function addServiceProviders(params) {
  //服务商  新增服务商提交
  return request({
    url: "/product/v31/api/agent/save",
    // url:'http://192.168.5.172/product/v31/api/agent/save',
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function updateServiceProviders(params, id) {
  //服务商 详情页面 修改提交
  return request({
    url: "/product/v31/api/agent/update/" + id,
    method: "put",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getPaymentList(params) {
  //服务商 详情页面 支付列表查询
  return request({
    url: "/product/v31/api/agent/profit/page",
    // url:'http://192.168.5.172/product/v31/api/agent/profit/page',
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getConfigureChannels(params, id) {
  //服务商 详情页面 渠道配置获取数据
  return request({
    url: "/product/v31/api/agent/getchannels/" + id,
    // url:'http://192.168.5.172/product/v31/api/agent/getchannels/' + id,
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function postConfigureChannels(params, id) {
  //服务商 详情页面 添加渠道配置
  return request({
    url: "/product/v31/api/agent/configchannel/" + id,
    // url:'http://192.168.5.172/product/v31/api/agent/configchannel/' + id,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getRateList(params) {
  //服务商 详情页面 获取支付通道费率
  return request({
    url: "/product/v31/api/agent/rate/list",
    // url:'http://192.168.5.172/product/v31/api/agent/rate/list',
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function agentRateConfirm(params, id) {
  //服务商  费率验证
  return request({
    url: "/product/v31/api/agent/rate/confirm/" + id,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function postSubmitRates(params, id) {
  //服务商 详情页面 修改提交支付通道费率
  return request({
    url: "/product/v31/api/agent/rate/update/" + id,
    // url:'http://192.168.5.172/product/v31/api/agent/rate/update/'+ id,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getdimensionTagList(params) {
  //服务商 详情页面 获取指定对象已拥有的标签
  return request({
    url: "/product/v31/api/dimensionTag/list",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getSelectTagsByRole(params) {
  //服务商 详情页面 获取指定对象可添加标签
  return request({
    url: "/product/v31/api/tag/getSelectTagsByRole",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function postDimensionTagSave(data) {
  //服务商 详情页面 给指定对象添加标签
  return request({
    url: "/product/v31/api/dimensionTag/save",
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getBdList(params) {
  //业务经理列表
  return request({
    url: "/product/v31/api/bd/page",
    // url: "http://192.168.5.172/product/v31/api/bd/page",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function addBdManager(params) {
  //新增业务经理
  return request({
    url: "/product/v31/api/bd/save",
    // url: "http://192.168.5.172/product/v31/api/bd/save",
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function deleteBD(params, id) {
  //服务商  删除服务商
  return request({
    url: "/product/v31/api/bd/delete/" + id,
    method: "put",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getBdData(params, id) {
  //业务经理  详情页获取数据
  return request({
    url: "/product/v31/api/bd/get/" + id,
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function reviseBusiness(params, id) {
  //服务商 详情页面 修改提交
  return request({
    url: "/product/v31/api/bd/update/" + id,
    method: "put",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getBankAccount(params) {
  //清算查询查询 获取列表数据
  return request({
    url: "/product/v31/api/trade/getSettlement",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getClearingQuery(params) {
  //清算查询查询 获取列表数据
  return request({
    url: "/product/v31/api/trade/transaction/page",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getClearingExport(params) {
  //清算查询查询 导出数据
  return request({
    url: "/product/v31/api/trade/transaction/excel",
    method: "get",
    params,
    responseType: "arraybuffer", // 代表内存之中的一段二进制数据 必须加
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getProfits(params) {
  //分润统计 获取列表数据
  return request({
    url: "/product/v31/api/trade/getProfits/statistics",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getProfitsBdDetail(params) {
  //分润统计 获取下级分润详情
  return request({
    url: "/product/v31/api/trade/getProfits/statistics/bdDetail",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getAgentStatistics(params) {
  //服务商交易统计 获取列表数据
  return request({
    url: "/product/v31/api/trade/getAgentStatistics",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getMerchantProfits(params) {
  //服务商交易统计 统计详情
  return request({
    url: "/product/v31/api/trade/getMerchantProfits",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function getSettlement(params, id) {
  // 获取通道结算周期列表
  return request({
    url: "/product/v31/api/channel/getSettlement/" + id,
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function channelselect(params) {
  // 切通道下拉列表
  return request({
    url: "/product/v31/api/merchant/channel/select",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function divideChannelList(params) {
  // 获取可选分账通道下拉列表
  return request({
    url: "/product/v31/api/channel/list" ,
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function channelselects(params, id) {
  // 获取可选通道下拉列表
  return request({
    url: "/product/v31/api/merchant/channel/select/" + id,
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function updatechannel(params, id) {
  // 切换通道
  return request({
    url: "/product/v31/api/merchant/update/channel/" + id,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function applist(params) {
  // 获取微信关注列表
  return request({
    url: "/product/v31/api/merchant/app/list",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function updatesettlement(params, id) {
  // 修改结算周期
  return request({
    url: "/product/v31/api/merchant/channel/update/" + id,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function alipayauth(params, id) {
  // 支付宝口碑配置
  return request({
    url: "/product/v31/alipay/get/auth/" + id,
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function addbank(params, id) {
  // 配置银联商户号
  return request({
    url: "/product/v31/api/merchant/addbank/" + id,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function updateBankRate(params, id) {
  // 修改银行卡费率
  return request({
    url: "/product/v31/api/merchant/updateBankRate/" + id,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function deletechannel(params, id) {
  // 停用通道
  return request({
    url: "/product/v31/api/merchant/channel/delete/" + id,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function addchannels(params) {
  // add通道
  return request({
    url: "/product/v31/api/merchant/channel/save",
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
    timeout: "60000",
  });
}
export function registerQiMai(params, id) {
  // 开通智慧零售
  return request({
    url: "/product/v31/api/merchant/registerQiMai/" + id,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function menuupdate(params, id) {
  // 修改菜单
  return request({
    url: "/product/v31/api/menu/update/" + id,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function terminallist(params, id) {
  // 终端列表
  return request({
    url: "/product/v31/api/terminal/page",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function shopall(params) {
  // 通过商户获取门店
  return request({
    url: "/product/v31/api/merchant/shop/list",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function terminalsave(params) {
  // 添加终端
  return request({
    url: "/product/v31/api/terminal/save",
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function terminaldelete(params, id) {
  // 删除终端
  return request({
    url: "/product/v31/api/terminal/delete/" + id,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function terminalupdate(params, id) {
  // 修改终端
  return request({
    url: "/product/v31/api/terminal/update/" + id,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function devicepage(params) {
  // 设备列表
  return request({
    url: "/product/v31/api/device/page",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function devicesave(params) {
  // 添加设备
  return request({
    url: "/product/v31/api/device/save",
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function devicebind(params, id) {
  // 绑定设备
  return request({
    url: "/product/v31/api/device/bind/" + id,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function deviceremove(params, id) {
  // 解绑设备
  return request({
    url: "/product/v31/api/device/remove/" + id,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function merchantstatistics(params) {
  // 商户交易统计分页
  return request({
    url: "/product/v31/api/trade/list/merchant/statistics",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function merchantdetail(params) {
  // 商户交易统计详情
  return request({
    url: "/product/v31/api/trade/statistics/merchant/detail",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function merRefundStat(params) {
  // 商户退款统计分页
  return request({
    url: "/product/v31/api/refund/list/merchant/statistics",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function merRefundStatDetail(params) {
  // 商户退款统计详情
  return request({
    url: "/product/v31/api/refund/statistics/merchant/detail",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function shopstatistics(params) {
  // 门店交易统计分页
  return request({
    url: "/product/v31/api/shopDate/shopStatisticByDayPage",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function orderpage(params) {
  // 订单查询
  return request({
    url: "/product/v31/api/trade/page",
    method: "get",
    params,
    timeout: "60000",
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function refundPage(params) {
  // 订单查询
  return request({
    url: "/product/v31/api/refund/page",
    method: "get",
    params,
    timeout: "60000",
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function orderlist(params) {
  // 订单查询
  return request({
    url: "/product/v31/api/trade/list",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getOrderDetail(params) {
  // 订单统计
  return request({
    url: "/product/v31/api/trade/getOrderDetail",
    method: "get",
    params,
    timeout: "60000",
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getRefundStat(params) {
  // 订单统计
  return request({
    url: "/product/v31/api/refund/getRefundStat",
    method: "get",
    params,
    timeout: "60000",
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function tradeget(params, id) {
  // 订单详情
  return request({
    url: "/product/v31/api/trade/get/" + id,
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function refundorder(params, id) {
  // 订单退款
  return request({
    url: "/product/v31/api/trade/refund/order/" + id,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function shopSumByDay(params) {
  // 查询门店日结统计信息
  return request({
    url: "/product/v31/api/shopDate/shopSumByDay",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function terminalrelease(params, id) {
  // 解绑终端
  return request({
    url: "/product/v31/api/terminal/release/" + id,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function queryorder(params, id) {
  // 同步订单状态
  return request({
    url: "/product/v31/api/trade/query/order/" + id,
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function synchronizeKoubeiShop(params) {
  // 同步口碑门店
  return request({
    url: "/product/v31/api/merchant/shop/synchronizeKoubeiShop",
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function merchantenable(params, id) {
  // 启用商户
  return request({
    url: "/product/v31/api/merchant/enable/" + id,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function getLastWeekStatisticChart(params) {
  // 首页 获取近七天交易总趋势
  return request({
    url: "/product/v31/api/trade/getLastWeekStatisticChart",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getMerStatisticRank(params) {
  // 首页 获取商户排行
  return request({
    url: "/product/v31/api/trade/getMerStatisticRank",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getCountsByPayType(params) {
  // 首页 获取支付方式笔数
  return request({
    url: "/product/v31/api/trade/getCountsByPayType",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getMerCountInfo(params) {
  // 首页 获取新增商户数量
  return request({
    url: "/product/v31/api/trade/getMerCountInfo",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getShopStatisticRank(params) {
  // 首页 商户登陆 门店交易排行
  return request({
    url: "/product/v31/api/trade/getShopStatisticRank",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getStatisticByRole(params) {
  // 首页 获取总交易金额
  return request({
    url: "/product/v31/api/trade/getStatisticByRole",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getShopTerminals(params) {
  // 首页 获取门店下面终端
  return request({
    url: "/product/v31/api/trade/getShopTerminals",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getQrcodeList(params) {
  // 二维码管理 获取列表数据
  return request({
    url: "/product/v31/api/batch/page",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function addQrcode(params) {
  // 二维码管理 添加二维码账户
  return request({
    url: "/product/v31/api/batch/save",
    method: "post",
    params,
    timeout: "60000",
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getExportQrcode(params) {
  // 二维码管理 导出生成二维码
  return request({
    url: "/product/v31/api/qrcode/list",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function parentlist(params) {
  // 获取银行总行列表
  return request({
    url: "/product/v31/bank/parent/list",
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

// 
export function banklist(params) {
  // 开户支行
  return request({
    url: "/product/v31/bank/list",
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function merchantsave(params) {
  // 新增商户
  return request({
    url: "/product/v31/api/merchant/save",
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function uploadfileget(params, id) {
  // 获取审核照片
  return request({
    url: "/product/v31/api/merchant/uploadfile/get/" + id,
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function merchantreview(data, id) {
  // 审核商户
  return request({
    url: "/product/v31/api/merchant/review/" + id,
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function modifypassword(params, id) {
  // 用户修改密码
  return request({
    url: "/product/v31/api/user/modifypassword/" + id,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getRegistryChannnel(params, id) {
  // 获取可选进件渠道
  return request({
    url: "/product/v31/api/merchant/getRegistryChannnel/" + id,
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getMerchantHigherTags(params) {
  // 获取进件商户上级标签
  return request({
    url: "/product/v31/api/dimensionTag/getMerchantHigherTags/",
    method: "get",
    params,
    headers: { token: sessionStorage.getItem("token") },
  });
}
export function getReviewCount(params) {
  // 获取商户进件审核数量
  return request({
    url: "/product/v31/api/merchant/getReviewCount",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function updateToReview(data, id) {
  // 修改商户进件
  return request({
    url: "/product/v31/api/merchant/updateToReview/" + id,
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function shopstatisticss(params) {
  // 门店交易统计old
  return request({
    url: "/product/v31/api/trade/list/shop/statistics",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function shopRefundStat(params) {
  // 门店退款统计
  return request({
    url: "/product/v31/api/refund/list/shop/statistics",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function merchantupdate(data, id) {
  // 修改商户进件（渠道）
  return request({
    url: "/product/v31/api/merchant/update/" + id,
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function merchantcopy(data, id) {
  // 复制商户
  return request({
    url: "/product/v31/api/merchant/copy/" + id,
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function updMerCustProp(data) {
  // 修改商户特殊属性（别名）
  return request({
    url: "/product/v31/api/merchant/updCustProp",
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function temPexportExcels(params) {
  // 导出订单
  return excelRequest({
    url: "/product/v31/api/system/tradeFormTemp/tradeExcel",
    method: "post",
    params,
    timeout: "300000",
    headers: {
      "Content-Type": "application/json",
      token: sessionStorage.getItem("token"),
    },
  });
}

export function exportExcels(params) {
  // 导出订单
  return excelRequest({
    url: "/product/v31/api/trade/export/excel",
    method: "get",
    params,
    timeout: "300000",
    headers: {
      "Content-Type": "application/json",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function exportRecordlist(params) {
  // 导出任务记录分页
  return request({
    url: "/product/v31/api/exportRecord/list",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function exportRecorddelete(params, id) {
  // 导出任务删除
  return request({
    url: "/product/v31/api/exportRecord/delete/" + id,
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function exportExcel(params) {
  // 导出订单  (废弃)
  return excelRequest({
    url: "/product/v31/api/trade/export/excel",
    method: "get",
    params,
    timeout: "600000",
    headers: {
      "Content-Type": "application/json",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function merchantexcel(params) {
  // 导出商户交易统计
  return excelRequest({
    url: "/product/v31/api/trade/export/merchant/excel",
    method: "get",
    params,
    timeout: "180000",
    headers: {
      "Content-Type": "application/json",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function merRefundStatExcel(params) {
  // 导出商户交易统计
  return excelRequest({
    url: "/product/v31/api/refund/export/merchant/excel",
    method: "get",
    params,
    timeout: "180000",
    headers: {
      "Content-Type": "application/json",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function shopDateexportExcel(params) {
  // 导出门店日结
  return excelRequest({
    url: "/product/v31/api/shopDate/exportExcel",
    method: "get",
    params,
    timeout: "60000",
    headers: {
      "Content-Type": "application/json",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function statisticexcel(params) {
  // 导出服务商交易统计
  return excelRequest({
    url: "/product/v31/api/trade/export/agent/statistic/excel",
    method: "get",
    params,
    timeout: "60000",
    headers: {
      "Content-Type": "application/json",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getProfitsexcel(params) {
  // 导出分润统计
  return excelRequest({
    url: "/product/v31/api/trade/export/getProfits/excel",
    method: "get",
    params,
    timeout: "60000",
    headers: {
      "Content-Type": "application/json",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function transactionexcel(params) {
  // 导出清算查询
  return excelRequest({
    url: "/product/v31/api/trade/transaction/excel",
    method: "get",
    params,
    timeout: "60000",
    headers: {
      "Content-Type": "application/json",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function merchantdetailexcel(params) {
  // 导出商户订单统计详情
  return excelRequest({
    url: "/product/v31/api/trade/export/merchant/detail/excel",
    method: "get",
    params,
    timeout: "60000",
    headers: {
      "Content-Type": "application/json",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function merRefundStatDetailExcel(params) {
  // 导出商户退款统计详情
  return excelRequest({
    url: "/product/v31/api/refund/export/merchant/detail/excel",
    method: "get",
    params,
    timeout: "60000",
    headers: {
      "Content-Type": "application/json",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function profitdetailexcel(params) {
  // 服务商分润详情（商户每笔订单分润）导出
  return excelRequest({
    url: "/product/v31/api/trade/export/profitdetail/excel",
    method: "get",
    params,
    timeout: "60000",
    headers: {
      "Content-Type": "application/json",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function myMerchantExcel(params) {
  // 我的商户导出导出
  return excelRequest({
    url: "/product/v31/api/merchant/export/excel",
    method: "get",
    params,
    timeout: "60000",
    headers: {
      "Content-Type": "application/json",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function shopExcel(params) {
  // 我的门店导出
  return excelRequest({
    url: "/product/v31/api/merchant/shop/export/excel",
    method: "get",
    params,
    timeout: "60000",
    headers: {
      "Content-Type": "application/json",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function storesExportExcel(params) {
  // 门店交易统计导出
  return excelRequest({
    url: "/product/v31/api/trade/export/shop/excel",
    method: "get",
    params,
    timeout: "60000",
    headers: {
      "Content-Type": "application/json",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function storesRefundExportExcel(params) {
  // 门店交易统计导出
  return excelRequest({
    url: "/product/v31/api/refund/export/shop/excel",
    method: "get",
    params,
    timeout: "60000",
    headers: {
      "Content-Type": "application/json",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function merchanttransfer(data, id) {
  // 修改业务经理
  return request({
    url: "/product/v31/api/merchant/transfer/" + id,
    method: "post",
    data,
    headers: {
      "Content-Type": "application/json",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function wechatRegistry(data, id) {
  // 申请小微进件
  return request({
    url: "/product/v31/api/merchant/wechatRegistry/" + id,
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function elecContractSign(params, id) {
  // 签约随行付电子协议
  return request({
    url: "/product/v31/api/merchant/sxf/elecContractSign/" + id,
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getSignInfoMerchant(params, id) {
  // 用户信息 商户登陆 签约信息
  return request({
    url: "/product/v31/api/merchant/getSignInfo/" + id,
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getInventory(params) {
  // 库存管理 获取数据列表
  return request({
    url: "/product/v31/api/inventory/page",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getInventoryCategoryListlev(params) {
  // 库存管理 获取设备类型
  return request({
    url: "/product/v31/api/inventoryCategory/list",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getInventoryExport(data) {
  // 库存管理 出库
  return request({
    url: "/product/v31/api/inventory/export",
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getInventoryImportSingle(data) {
  // 库存管理 单个入库
  return request({
    url: "/product/v31/api/inventory/importSingle",
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getInventoryUpdate(data, id) {
  // 库存管理 单个编辑
  return request({
    url: "/product/v31/api/inventory/update/" + id,
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getInventoryBatchRemove(data) {
  // 库存管理 删除和批量删除
  return request({
    url: "/product/v31/api/inventory/batchRemove",
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getInventoryBatchSwitchHolder(data) {
  // 库存管理 批量切换
  return request({
    url: "/product/v31/api/inventory/batchSwitchHolder",
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getInventoryBatchIn(data) {
  // 库存管理 批量修改入库
  return request({
    url: "/product/v31/api/inventory/batchIn",
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getInventoryExcel(params) {
  // 库存管理 库存导出
  return excelRequest({
    url: "/product/v31/api/inventory/export/excel",
    method: "get",
    params,
    timeout: "60000",
    headers: {
      "Content-Type": "application/json",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getlabelTagPage(params) {
  // 标签管理 获取标签列表
  return request({
    url: "/product/v31/api/tag/page",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getlabelTagList(params) {
  // 标签管理 标签模糊
  return request({
    url: "/product/v31/api/tag/list",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getDimensionTagList(params) {
  // 标签管理 根据维度标签模糊
  return request({
    url: "/product/v31/api/dimensionTag/getRoleSelectTags",
    method: "get",
    params,
    headers: { token: sessionStorage.getItem("token") },
  });
}
export function getlabelTagSave(data) {
  // 标签管理 新增标签
  return request({
    url: "/product/v31/api/tag/save",
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getlabelTagUpdate(data, id) {
  // 标签管理 标签编辑
  return request({
    url: "/product/v31/api/tag/update/" + id,
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getlabelTagDelete(data, id) {
  // 标签管理 标签删除
  return request({
    url: "/product/v31/api/tag/delete/" + id,
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getlabelTagDetails(params, id) {
  // 标签管理 获取详情页数据
  return request({
    url: "/product/v31/api/tag/get/" + id,
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function postDimensionTagRemove(data, id) {
  // 详情页 标签删除功能
  return request({
    url: "/product/v31/api/dimensionTag/remove/" + id,
    method: "post",
    data,
    headers: { token: sessionStorage.getItem("token") },
  });
}
export function setGreenStatus(data, id) {
  // 开通绿洲
  return request({
    url: "/product/v31/api/merchant/channel/setGreenStatus/" + id,
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function setBlueStatus(data, id) {
  // 开通蓝海
  return request({
    url: "/product/v31/api/merchant/channel/setBlueStatus/" + id,
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
// 修改微信关注配置
export function appsave(data) {
  return request({
    url: "/product/v31/api/merchant/app/save",
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
// 删除微信关注配置
export function appremove(data, id) {
  return request({
    url: "/product/v31/api/merchant/app/remove/" + id,
    method: "delete",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function shopdeletes(data, id) {
  // 停用门店
  return request({
    url: "/product/v31/api/merchant/shop/delete/" + id,
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getDeviceType(params) {
  // 标签管理 获取详情页数据
  return request({
    url: "/product/v31/api/inventoryCategory/getDeviceType",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function postAdMaterial(data) {
  // 广告管理 广告素材 上传素材
  return request({
    url: "/product/v31/api/adMaterial/save",
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getAdMaterialPage(params) {
  // 广告管理 广告素材 获取素材列表
  return request({
    url: "/product/v31/api/adMaterial/page",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function postAdMaterialDelete(data, id) {
  // 广告管理 广告素材 删除素材
  return request({
    url: "/product/v31/api/adMaterial/delete/" + id,
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function postAdInfoSave(data) {
  // 广告管理 发布广告
  return request({
    url: "/product/v31/api/adInfo/save",
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getAdInfoPage(params) {
  // 广告管理 获取广告列表
  return request({
    url: "/product/v31/api/adInfo/page",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getAdInfoEdit(params, id) {
  // 广告管理 获取广告详情
  return request({
    url: "/product/v31/api/adInfo/get/" + id,
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function postAdInfoUpdate(data, id) {
  // 广告管理 编辑提交
  return request({
    url: "/product/v31/api/adInfo/update/" + id,
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function postAdInfoSuspend(data, id) {
  // 广告管理 暂停广告
  return request({
    url: "/product/v31/api/adInfo/suspend/" + id,
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function postAdInfoDelete(data, id) {
  // 广告管理 删除广告
  return request({
    url: "/product/v31/api/adInfo/delete/" + id,
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function postAdInfoStart(data, id) {
  // 广告管理 广告上架
  return request({
    url: "/product/v31/api/adInfo/start/" + id,
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function inventoryCategorylist(params) {
  // 获取设备品牌
  return request({
    url: "/product/v31/api/inventoryCategory/list",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function agentoem(params) {
  // 获取OEM配置
  return request({
    url: "/product/v31/api/agent/oem",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function oemupdate(data) {
  //修改OEM配合
  return request({
    url: "/product/v31/api/agent/oem/update",
    method: "POST",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function oemsave(data) {
  //一级服务商开通OEM
  return request({
    url: "/product/v31/api/agent/oem/save",
    method: "POST",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function setLimitInst(data) {
  //开通机构限额
  return request({
    url: "/product/v31/api/inst/setLimitInst",
    method: "POST",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function findUserInst(params) {
  // 查询用户关联的机构
  return request({
    url: "/product/v31/api/inst/findUserInst",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function recharge(params) {
  // 机构额度充值
  return request({
    url: "/yfpay/inst/recharge",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function chargeOrderQuery(params) {
  // 查询充值是否成功
  return request({
    url: "/product/v31/api/inst/chargeOrderQuery",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function instid(params, id) {
  // 机构详情
  return request({
    url: "/product/v31/api/inst/get/" + id,
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function chargeOrderPage(params) {
  // 重充值列表
  return request({
    url: "/product/v31/api/inst/chargeOrderPage",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getLimitNum(params, id) {
  // 查询机构额度
  return request({
    url: "/product/v31/api/inst/getLimitNum/" + id,
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function configLimit(data) {
  //手动调整机构额度
  return request({
    url: "/product/v31/api/inst/configLimit",
    method: "POST",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function goodspage(params) {
  // 商品列表
  return request({
    url: "/product/v31/api/goods/page",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function goodsCategorylist(params) {
  // 获取商品分类
  return request({
    url: "/product/v31/api/goodsCategory/list",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function goodssave(data) {
  //新增商品
  return request({
    url: "/product/v31/api/goods/save/",
    method: "POST",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function goodsupdate(data, id) {
  //修改商品
  return request({
    url: "/product/v31/api/goods/update/" + id,
    method: "POST",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function goodsremove(data, id) {
  //修改商品
  return request({
    url: "/product/v31/api/goods/remove/" + id,
    method: "POST",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function goodsget(params, id) {
  // 获取商品详情
  return request({
    url: "/product/v31/api/goods/get/" + id,
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function rentTradepage(params) {
  // 信用租账单列表
  return request({
    url: "/product/v31/api/rentTrade/page",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function rentTradeget(params, id) {
  // 信用租账单详情
  return request({
    url: "/product/v31/api/rentTrade/get/" + id,
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function rentpage(params) {
  // 信用租商品列表
  return request({
    url: "/product/v31/api/rent/page",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function unFreeze(data, id) {
  //撤销订单
  return request({
    url: "/product/v31/api/rent/unFreeze/" + id,
    method: "POST",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function dictionarylist(params) {
  // 获取通道
  return request({
    url: "/product/v3/sbapi/dictionary/list",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function chainopen(params) {
  // 开通总分店模式
  return request({
    url: "/product/v31/api/merchant/chain/open",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function chainclose(params) {
  // 关闭总分店模式
  return request({
    url: "/product/v31/api/merchant/chain/close",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function chaindetail(params) {
  // 总分店模式信息详情
  return request({
    url: "/product/v31/api/merchant/chain/detail",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function chainupdate(params) {
  // 更新总分店模式配置
  return request({
    url: "/product/v31/api/merchant/chain/update",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function tradeNotify(params) {
  //补发通知
  return request({
    url: "/product/v31/api/trade/tradeNotify",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function hlspage(params) {
  //华莱士对账单
  return excelRequest({
    url: "/product/v31/api/hls/page",
    method: "get",
    params,
    headers: {
      "Content-Type": "application/json;charset=utf-8",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function hlsexcel(params) {
  // 导出华莱士对账单
  return excelRequest({
    url: "/product/v31/api/hls/excel",
    method: "get",
    params,
    timeout: "180000",
    headers: {
      "Content-Type": "application/json",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function chainsubs(params) {
  // 查询通道分店商户列表
  return excelRequest({
    url: "/product/v31/api/merchant/chain/subs",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function splitinfo(params) {
  // 查询商户通道分账配置
  return excelRequest({
    url: "/product/v31/api/merchant/split/info",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function splitconfigt(data) {
  //总店商户通道分账配置
  return request({
    url: "/produc/v31/api/merchant/split/configt",
    method: "POST",
    data,
    headers: {
      "Content-Type": "application/json",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function splitopen(params) {
  // 商户开通通道分账
  return excelRequest({
    url: `/product/v31/api/merchant/split/opensyn/`,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function joblist(params) {
  // 定时任务列表
  return excelRequest({
    url: "/product/v31/api/job/list",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function jobadd(data) {
  //新增定时任务
  return request({
    url: "/product/v31/api/job/add",
    method: "POST",
    data,
    headers: {
      // "Content-Type": 'application/json',
      token: sessionStorage.getItem("token"),
    },
  });
}
export function jobupdate(data) {
  //修改定时任务
  return request({
    url: "/product/v31/api/job/update",
    method: "POST",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function jobpause(params, id) {
  // 暂停任务
  return excelRequest({
    url: "/product/v31/api/job/pause/" + id,
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function jobstart(params, id) {
  // 启动任务
  return excelRequest({
    url: "/product/v31/api/job/start/" + id,
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function jobdelete(params, id) {
  // 删除任务
  return excelRequest({
    url: "/product/v31/api/job/delete/" + id,
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function paycfg(data, id) {
  //商户支付权限配置
  return request({
    url: "/product/v31/api/merchant/pay/cfg/" + id,
    method: "POST",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getBdStatistics(params) {
  // 业务经理交易统计分页
  return excelRequest({
    url: "/product/v31/api/trade/getBdStatistics",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function bdstatisticexcel(params) {
  // 导出业务经理交易统计
  return excelRequest({
    url: "/product/v31/api/trade/export/bd/statistic/excel",
    method: "get",
    params,
    timeout: "180000",
    headers: {
      "Content-Type": "application/json",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function get3Bind(data, id) {
  //获取IoT设备三绑定参数
  return request({
    url: "/product/v31/api/terminal/get3Bind/" + id,
    method: "POST",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function config3Bind(data) {
  //IoT设备三绑定
  return request({
    url: "/product/v31/api/terminal/config3Bind",
    method: "POST",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function operationresult(params) {
  // 查询服务商代运营操作结果
  return request({
    url: "/product/v31/alipay/operation/result",
    method: "get",
    params,
    timeout: "180000",
    headers: {
      "Content-Type": "application/json",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function operationapply(params) {
  // 向商户支付宝发起授权推送
  return request({
    url: "/product/v31/alipay/operation/apply",
    method: "get",
    params,
    timeout: "180000",
    headers: {
      "Content-Type": "application/json",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function syncShop(params) {
  // 同步支付宝门店信息
  return request({
    url: "/product/v31/alipay/operation/syncShop",
    method: "get",
    params,
    timeout: "180000",
    headers: {
      "Content-Type": "application/json",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function usersLogpage(params) {
  // 日志列表
  return request({
    url: "/product/v31/api/usersLog/page",
    method: "get",
    params,
    timeout: "180000",
    headers: {
      "Content-Type": "application/json",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function blueSeaquery(data) {
  //蓝海活动报名查询
  return request({
    url: "/product/v31/alipay/blueSea/query",
    method: "POST",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function blueSeaapply(data) {
  //蓝海活动报名申请
  return request({
    url: "/product/v31/alipay/blueSea/apply",
    method: "POST",
    data,
    timeout: "50000",
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function blueSeamodify(data) {
  //蓝海活动报名修改
  return request({
    url: "/product/v31/alipay/blueSea/modify",
    method: "POST",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function check3Bind(data, id) {
  //3绑定关系校验
  return request({
    url: "/product/v31/api/terminal/check3Bind/" + id,
    method: "POST",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function channeldetail(params, id) {
  // 商户通道定制详情
  return request({
    url: "/product/v31/api/merchant/channel/detail/" + id,
    method: "get",
    params,
    headers: {
      "Content-Type": "application/json",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function channeldetailupdate(data, id) {
  //商户通道定制更新
  return request({
    url: "/product/v31/api/merchant/channel/detail/update/" + id,
    method: "POST",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function tradehistory(params) {
  // 历史订单列表
  return request({
    url: "/product/v31/api/trade/page/history",
    method: "get",
    params,
    timeout: "300000",
    headers: {
      "Content-Type": "application/json",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getOrderDetailhistory(params) {
  // 历史交易列表信息汇总
  return request({
    url: "/product/v31/api/trade/getOrderDetail/history",
    method: "get",
    params,
    timeout: "300000",
    headers: {
      "Content-Type": "application/json",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function exportExcelshistory(params) {
  // 导出历史订单
  return excelRequest({
    url: "/product/v31/api/trade/export/excel/history",
    method: "get",
    params,
    timeout: "300000",
    headers: {
      "Content-Type": "application/json",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function tradeinfohistory(params) {
  // 历史订单详情
  return excelRequest({
    url: "/product/v31/api/trade/info/history",
    method: "get",
    params,
    timeout: "300000",
    headers: {
      "Content-Type": "application/json",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function exportRecordlisthis(params) {
  // 历史订单导出
  return excelRequest({
    url: "/product/v31/api/exportRecord/list/history",
    method: "get",
    params,
    timeout: "300000",
    headers: {
      "Content-Type": "application/json",
      token: sessionStorage.getItem("token"),
    },
  });
}
export function exportRecorddeletehis(params, id) {
  // 导出历史任务删除
  return request({
    url: "/product/v31/api/exportRecord/delete/history/" + id,
    method: "POST",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function mdrecord(data) {
  //查询门店
  return request({
    url: "/product/v31/api/merchant/shop/list",
    method: "get",
    data,
    headers: {
      // 'Content-Type': 'application/json',
      token: sessionStorage.getItem("token"),
    },
  });
}

export function hxrecord(data) {
  //查询核销列表
  return request({
    url: "/product/v31/api/writeoffrecord/list",
    method: "POST",
    data,
    headers: {
      // 'Content-Type': 'application/json',
      token: sessionStorage.getItem("token"),
      
    },
  });
}

export function shrecord(data) {
  //查询商户
  return request({
    url: "/product/v31/api/merchant/page",
    method: "get",
    data,
    headers: {
      // 'Content-Type': 'application/json',
      token: sessionStorage.getItem("token"),
    },
  });
}

export function verification(data) {
  //核销
  return request({
    url: "/product/v31/api/writeoff/writeoffCoupon",
    method: "POST",
    data,
    headers: {
      // 'Content-Type': 'application/json',
      token: sessionStorage.getItem("token"),
    },
  });
}

export function writeoffrecordWriteoffCount(data) {
  //查询核销数量
  return request({
    url: "/product/v31/api/writeoffrecord/writeoffCount",
    method: "POST",
    data,
    headers: {
      // 'Content-Type': 'application/json',
      token: sessionStorage.getItem("token"),
    },
  });
}

export function writeoffCancel(data) {
  //撤销核销
  return request({
    url: "/product/v31/api/writeoff/cancel",
    method: "POST",
    data,
    headers: {
      // 'Content-Type': 'application/json',
      token: sessionStorage.getItem("token"),
    },
  });
}

export function writeoffrecordInfo(params, id) {
  // 查询核销详情
  return request({
    url: "/product/v31/api/writeoffrecord/info/" + id,
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function coupontypeList(params) {
  //查询优惠券模板列表
  return request({
    url: "/product/v31/api/coupontype/list",
    method: "POST",
    params,
    headers: {
      // 'Content-Type': 'application/json',
      token: sessionStorage.getItem("token"),
    },
  });
}

export function coupontypeSave(params) {
  //新增优惠券模板
  return request({
    url: "/product/v31/api/coupontype/saveOrUpdate",
    method: "POST",
    params,
    headers: {
      // 'Content-Type': 'application/json',
      token: sessionStorage.getItem("token"),
    },
  });
}

export function coupontypeDelete(params) {
  //删除优惠券
  return request({
    url: "/product/v31/api/coupontype/delete",
    method: "POST",
    params,
    headers: {
      // 'Content-Type': 'application/json',
      token: sessionStorage.getItem("token"),
    },
  });
}

export function coupontypeInfo(params, id) {
  // 查询优惠券详情
  return request({
    url: "/product/v31/api/coupontype/info/" + id,
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function couponList(params) {
  //查询优惠券列表
  return request({
    url: "/product/v31/api/coupon/list",
    method: "POST",
    params,
    headers: {
      // 'Content-Type': 'application/json',
      token: sessionStorage.getItem("token"),
    },
  });
}

export function dictionarysdsadList(params) {
  //查询数据字典列表
  return request({
    url: "/product/v31/sbapi/dictionary/dirList",
    method: "get",
    params,
    headers: {
      // 'Content-Type': 'application/json',
      token: sessionStorage.getItem("token"),
    },
  });
}

export function openMerPoint(params) {
  // 开通商户流量包
  return request({
    url: "/product/v31/api/merpoint/save",
    method: "POST",
    params,
    headers: {
      // 'Content-Type': 'application/json',
      token: sessionStorage.getItem("token"),
    },
  });
}
export function findMerPoint(params, id) {
  // 查询商户流量包信息
  return request({
    url: "/product/v31/api/merpoint/info/" + id,
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function alertMerPoint(params) {
  // 修改商户流量包
  return request({
    url: "/product/v31/api/merpoint/update",
    method: "POST",
    params,
    headers: {
      // 'Content-Type': 'application/json',
      token: sessionStorage.getItem("token"),
    },
  });
}
export function adjustPoint(params) {
  // 商户流量包调额
  return request({
    url: "/product/v31/api/merpoint/adjustPoint",
    method: "POST",
    params,
    headers: {
      // 'Content-Type': 'application/json',
      token: sessionStorage.getItem("token"),
    },
  });
}
export function merChargeOrderPage(params) {
  // 商户流量账单列表
  return request({
    url: "/product/v31/api/mpr/list",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getSplitList(params) {
  // 分页列表查询
  return request({
    url: `/product/v31/api/tradesplit/list`,
    method: "POST",
    params: params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getTradeDetail(id) {
  // 分账详情查询
  return request({
    url: `/product/v31/api/tradesplit/info/${id}`,
    method: "get",
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getCouponChannel() {
  // 查询核销通道
  return request({
    url: `/product/v31/api/writeoff/queryCouponChannel?merchantId=321`,
    method: "get",
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getInstitutionChannels(id) {
  // 获取机构通道配置
  return request({
    url: `/product/v31/api/agent/coupon/getchannels/${id}`,
    method: "get",
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function institutionChannelsConfig(params, id) {
  // 机构通道配置
  return request({
    url: `/product/v31/api/agent/coupon/configchannel/${id}`,
    method: "POST",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getRegistryCouponChannel(id) {
  // 获取优惠券机构所属的通道
  return request({
    url: `/product/v31/api/merchant/channel/coupon/select/${id}`,
    method: "get",
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getChannelSelect(id) {
  // 优惠券切通道下拉列表
  return request({
    url: `/product/v31/api/merchant/channel/coupon/list?merchantId=${id}`,
    method: "get",
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function postChannelSelect(params) {
  // 优惠券商户通道进件
  return request({
    url: `/product/v31/api/merchant/channel/coupon/save`,
    method: "POST",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function getCouponMerchantInfo(merchantId, channelId) {
  // 查询商户优惠券通道配置详情
  return request({
    url: `/product/v31/api/merchant/queryCouponMerchantInfo?merchantId=${merchantId}&channelId=${channelId}`,
    method: "get",
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function updateCouponMerchantInfo(params) {
  // 更新优惠券通道配置信息
  return request({
    url: `/product/v31/api/merchant/updateCouponChannelInfo`,
    method: "POST",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function additionalOrder(data) {
  // 补录订单
  return request({
    url: `/product/v31/api/trade/supply`,
    method: "POST",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function shopEnableWf(id) {
  // 门店核销功能开关
  return request({
    url: `/product/v31/api/merchant/shop/enableWf/${id}`,
    method: "GET",
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function shopCpchCfgList(id) {
  // 门店核销通道配置清单
  return request({
    url: `/product/v31/api/shopcpchcfg/listByShop/${id}`,
    method: "GET",
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function cpchCfgEdit(data) {
  // 创建门店核销通道配置
  return request({
    url: `/product/v31/api/shopcpchcfg/edit`,
    method: "POST",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function rpaQryLogin(id) {
  // rpa查询登录状态
  return request({
    url: `/product/v31/api/rpa/queryLogin/${id}`,
    method: "GET",
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function rpaLogin(data) {
  // rpa登录
  return request({
    url: `/product/v31/api/rpa/login`,
    method: "POST",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function rpaSmsConfirm(id, smsCode) {
  // rpa回填短信验证码登录
  return request({
    url: `/product/v31/api/rpa/smsConfirm/${id}/${smsCode}`,
    method: "GET",
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function confirmSplitConfig(data) {
  // 确定分账配置
  return request({
    url: `/product/v31/api/merchant/split/config`,
    method: "POST",
    data,
    headers: {
      "Content-Type": "application/json",
      token: sessionStorage.getItem("token"),
    },
  });
}

export function freezeOrder(data) {
  // 根据冻结订单号查询相关订单
  return request({
    url: `/product/v31/api/trade/freezeOrder/list/${data}`,
    method: "get",
    data,
    headers: {
      "Content-Type": "application/json",
      token: sessionStorage.getItem("token"),
    },
  });
}

export function resourcePage(params) {
  // 资源管理分页
  return request({
    url: "/product/v31/api/resource/page",
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function resourceSave(params) {
  // 新增资源
  return request({
    url: "/product/v31/api/resource/save",
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function resourceUpdate(params) {
  // 修改资源
  return request({
    url: "/product/v31/api/resource/update",
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function resourceDelete(id) {
  // 删除资源
  return request({
    url: "/product/v31/api/resource/delete/" + id,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function goodsAndcoupon(id) {
  // 商品及优惠信息
  return request({
    url: `/product/v31/api/trade/getInfo/${id}`,
    method: "get",
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function addCoupon(data) {
  // 新增商户分摊信息
  return request({
    url: "/product/v31/api/merchantCouponRatio/save",
    method: "post",
    data,
    headers: {
      // "Content-Type":'application/json',
      token: sessionStorage.getItem("token"),
    },
  });
}

export function updateCoupon(data) {
  // 新增商户分摊信息
  return request({
    url: "/product/v31/api/merchantCouponRatio/update",
    method: "post",
    data,
    headers: {
      // "Content-Type":'application/json',
      token: sessionStorage.getItem("token"),
    },
  });
}

export function delCoupon(data) {
  // 删除分摊信息
  return request({
    url: "/product/v31/api/merchantCouponRatio/delete/" + data.id,
    method: "post",
    headers: {
      // "Content-Type":'application/json',
      token: sessionStorage.getItem("token"),
    },
  });
}

export function couponDe(id) {
  // 查看分摊信息
  return request({
    url: "/product/v31/api/merchantCouponRatio/info/" + id,
    method: "GET",
    headers: {
      // "Content-Type":'application/json',
      token: sessionStorage.getItem("token"),
    },
  });
}

export function getCoupon(params) {
  // 商户分摊分页
  return request({
    url: "/product/v31/api/merchantCouponRatio/page",
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
/**
 * 
 * @param {string} id 
 * @returns promise
 */
export function getQuota(id) {
  // 查询额度包数据
  return request({
    url: `/product/v31/api/merchant/quotaById/${id}`,
    method: "get",
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

/**
 * 
 * @param {string} id 
 * @param {object} params 
 * @returns promise
 */
export function updateQuota(id, params) {
  // 配置额度包
  return request({
    url: `/product/v31/api/merchant/quotaUpdate/${id}`,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

/**
 * 额度包列表数据查询接口
 * @param {String} page
 * @param {Object} params
 * @returns promise
 */
export function APIgetQuotaStatisticsList(params) {
  return request({
    url: '/product/v31/api/merchant/quotaPage',
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
/**
 * 额度包列表统计接口
 * @param {Object} params 
 * @returns promise
 */
export function APIquotaStatistics(params) {
  return request({
    url: '/product/v31/api/merchant/quotaList',
    method: "get",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
/**
 * 关联星驿付接口
 * @returns promise
 */
export function APIrelatedStarPostPayment(id) {
  return request({
    url: `/product/v31/api/merchant/channel/starGotopMchNo/${id}`,
    method: 'post',
    headers: {
      token: sessionStorage.getItem("token"),
    }
  })
}

/**
 * 分账商户列表查询
 */
export function APISplitAccountMerchantList(params) {
  return request({
    url: "/product/v31/api/merchant/split/page",
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

/**
 * 电子账户列表查询
 */
export function APIElectronicAccountList(params) {
  return request({
    url: "/product/v31/api/merchant/walletMember/page",
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
/**
 * 提现记录列表查询
 */
export function APIWithdrawalRecordsList(params) {
  return request({
    url: "/product/v31/api/merchant/walletWithdraw/page",
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
/**
 * 分账记录列表查询
 */
export function APILedgerRecordsList(params) {
  return request({
    url: "/product/v31/api/merchant/tradeSplit/page",
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
/**
 * 分账商户统计
 */
export function APISplitAccountMerchantStatistics(params) {
  return request({
    url: "/product/v31/api/merchant/split/getActiveCount",
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
/**
 * 电子账户统计
 */
export function APIElectronicAccountStatistics(params) {
  return request({
    url: "/product/v31/api/merchant/walletMember/getActiveCount",
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
/**
 * 转账记录统计
 */
export function APITransferRecordStatistics(params) {
  return request({
    url: "/product/v31/api/merchant/walletTrade/page",
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
/**
 * 转账记录统计
 */
export function APIDivideAccountsConfiguration(params) {
  return request({
    url: "/product/v31/api/merchant/split/config",
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
/**
 * 获取所有的交易商户 
 */
export function APIallTransactionMerchantlist() {
  return request({
    url: "/product/v31/api/merchant/split/getTradeMerchant",
    method: "post",
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
/**
 * 获取分账通道
 */
export function APIDistributionChannelsList() {
  return request({
    url: "/product/v31/api/channel/getSplitChannelList",
    method: "post",
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
/**
 * 开通分账商户
 */
export function APIActivateSplitAccountMerchants(params) {
  return request({
    url: "/product/v31/api/merchant/split/add",
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
/**
 * 分账订单查询
 */
export function APILedgerOrderQuery(params) {
  return request({
    url: "/product/v31/api/merchant/tradeOrderSplit/page",
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
/**
 * 分账订单统计查询
 */
export function APILedgerOrderStatisticsQuery(params) {
  return request({
    url: "/product/v31/api/merchant/tradeOrderSplit/statistics",
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
  /**
   * 导出分账订单
   */
  export function APISplitOrderExcel(params) {
    return request({
      url: "/product/v31/api/merchant/tradeOrderSplit/tradeOrderSplitExcel",
      method: "post",
      params,
      headers: {
        token: sessionStorage.getItem("token"),
      },
    });
  }
  /**
   * 开通电子子账号
   */
  export function APIOpenElectronicLedger(params) {
    return request({
      url: "/product/v31/api/merchant/walletMember/add",
      method: "post",
      params,
      headers: {
        token: sessionStorage.getItem("token"),
      },
    });
  }
  /**
   * 电子账号详情查询
   */
  export function APIElectronicAccountDetails(id) {
    return request({
      url: `/product/v31/api/merchant/walletMember/get/${id}`,
      method: "get",
      headers: {
        token: sessionStorage.getItem("token"),
      },
    });
  }
  /**
   * 提现
   */
  export function APIWithdrawal(params) {
    return request({
      url: '/product/v31/api/merchant/walletWithdraw/doWithdraw',
      method: "post",
      params,
      headers: {
        token: sessionStorage.getItem("token"),
      },
    });
  }
  /**
   * 分账
   */
  export function APIDivideAccounts(params) {
    return request({
      url: '/product/v31/api/merchant/tradeOrderSplit/doSplit',
      method: "post",
      params,
      headers: {
        token: sessionStorage.getItem("token"),
      },
    });
  }
  /**
   * 导出分账记录表格
   */
  export function APILedgerRecordsExcel(params) {
    return request({
      url: '/product/v31/api/merchant/tradeSplit/tradeSplitExcel',
      method: "post",
      params,
      headers: {
        token: sessionStorage.getItem("token"),
      },
    });
  }
  /**
   * 导出提现记录表格
   */
  export function APIWithdrawalRecordsExcel(params) {
    return request({
      url: '/product/v31/api/merchant/walletWithdraw/exportWithdrawExcel',
      method: "post",
      params,
      headers: {
        token: sessionStorage.getItem("token"),
      },
    });
  }
  /**
   * 终端交易统计
   */
  export function APITerminalTransactionStatistics(params) {
    return request({
      url: '/product/v31/api/trade/terminalStatistics',
      method: "GET",
      params,
      headers: {
        token: sessionStorage.getItem("token"),
      },
    });
  }
  /**
   * 终端交易统计导出
   */
  export function APITerminalTransactionExcel(params) {
    return request({
      url: '/product/v31/api/trade/terminalStatisticsExcel',
      method: "GET",
      params,
      headers: {
        token: sessionStorage.getItem("token"),
      },
    });
  }
  /**
   * 电子账号详情查询
   */
  export function APIESplitOrderDetails(id) {
    return request({
      url: `/product/v31/api/merchant/tradeOrderSplit/get/${id}`,
      method: "get",
      headers: {
        token: sessionStorage.getItem("token"),
      },
    });
  }
  /**
   * 提现详情查询
   */
  export function APIWithdrawalDetails(id) {
    return request({
      url: `/product/v31/api/merchant/walletWithdraw/get/${id}`,
      method: "get",
      headers: {
        token: sessionStorage.getItem("token"),
      },
    });
  }
  /**
   * 提现详情页解绑按钮
   */
  export function APIunbindBankAcct(id) {
    return request({
      url: `/product/v31/api/merchant/walletMember/unbindBankAcct/${id}`,
      method: "post",
      headers: {
        token: sessionStorage.getItem("token"),
      },
    });
  }
  /**
 * 进件上传图片
 */

 export function APIuploadImage(imgurl, num) {
  return request({
    url: `/product/mini/upload/${num}`,
    method: "POST",
    // file: imgurl,
    filePath:imgurl,
    name: 'file',
    headers: {
      // token: sessionStorage.getItem("token"),
      "Content-Type": "multipart/form-data"
    },
  })
}

export function merchantDpayUrl(payType,mchNo) {
  //测试链接
  return request({
    url: `/product/test/pay/link/${payType}/${mchNo}`,
    method: "get",
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function formaAdd(data) {
  //智能表单新增
  return request({
    url: `/product/v31/api/system/form/add`,
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function formConfigList(params) {
  //智能表单查询
  return request({
    url: `/product/v31/api/system/form/page`,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function formConfigEdit(data) {
  //智能表单编辑
  return request({
    url: `/product/v31/api/system/form/edit`,
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function formConfigDelete(id) {
  //智能表单删除
  return request({
    url: `/product/v31/api/system/form/delete?id=${id}`,
    method: "post",
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function templateList(params) {
  //缴费通模板查询
  return request({
    url: `/product/v31/api/system/temp/page`,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function templateAdd(data) {
  //缴费通模板新增
  return request({
    url: `/product/v31/api/system/temp/add`,
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function templateEdit(data) {
  //缴费通模板编辑
  return request({
    url: `/product/v31/api/system/temp/edit`,
    method: "post",
    data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function templateDelete(id) {
  //缴费通模板编辑
  return request({
    url: `/product/v31/api/system/temp/delete?id=${id}`,
    method: "post",
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function createQrcode(id,userId) {
  //缴费通模板编辑
  return request({
    url: `/product/v31/api/system/temp/createQrcode?tempId=${id}&operatorId=${userId}`,
    method: "post",
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

// 

export function bindTerminalQrcode(id) {
  //缴费通模板编辑
  return request({
    url: `/product/v31/api/system/temp/bindTerminalQrcode?tempId=${id}`,
    method: "post",
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function templateOrderList(params) {
  //缴费通模板订单列表
  return request({
    url: `/product/v31/api/system/tradeFormTemp/page`,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function templateStatistics(params) {
  //缴费通模板订单统计
  return request({
    url: `/product/v31/api/system/tradeFormTemp/statistics`,
    method: "post",
    params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
export function PAPIaddCPlatform(data, id) {
  // 创建商户平台
  return request({
    url: `/product/v31/api/merchant/createThirdMerchantAccount?id=${id}&channelIds=${data}`,
    method: "post",
    // data,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}
 /**
   * 核销配置
   */
  export function APIqueryAllCouponChannel(params) {
    return request({
      url: '/product/v31/api/writeoff/queryAllCouponChannel',
      method: "GET",
      params,
      headers: {
        token: sessionStorage.getItem("token"),
      },
    });
  }
 /**
   * 修改核销配置
   */
  export function APIupdateCouponChannel(params) {
    return request({
      url: '/product/v31/api/writeoff/updateCouponChannel',
      method: "post",
      params,
      headers: {
        token: sessionStorage.getItem("token"),
      },
    });
  }
 /**
   * 获取手机验证码
   */
  export function APIgetPhoneCode(params) {
    return request({
      url: '/product/v31/api/user/sms',
      method: "get",
      params,
      headers: {
        token: sessionStorage.getItem("token"),
      },
    });
  }
 /**
   * 绑定手机号
   */
  export function APIBindPhone(params) {
    return request({
      url: '/product/v31/api/user/bindPhone',
      method: "post",
      params,
      headers: {
        token: sessionStorage.getItem("token"),
      },
    });
  }
 /**
   * 解除手机绑定
   */
  export function APIunBindPhone(params) {
    return request({
      url: '/product/v31/api/user/unBindPhone',
      method: "post",
      params,
      headers: {
        token: sessionStorage.getItem("token"),
      },
    });
  }
 /**
   * 获取用户绑定信息
   */
  export function APIunBindInfo(params) {
    return request({
      url: '/product/v31/api/user/getBindInfo',
      method: "post",
      params,
      headers: {
        token: sessionStorage.getItem("token"),
      },
    });
  }
 /**
   * 正佳订单查询接口
   */
  export function APIzjbill(params) {
    return request({
      url: '/product/v31/api/zjbill/page',
      method: "post",
      params,
      headers: {
        token: sessionStorage.getItem("token"),
      },
    });
  }
 /**
   * 正佳统计接口
   */
  export function APIzjbillstatistics(params) {
    return request({
      url: '/product/v31/api/zjbill/statistics',
      method: "post",
      params,
      headers: {
        token: sessionStorage.getItem("token"),
      },
    });
  }
 /**
   * 正佳订单导出接口
   */
  export function APIzjbillexcel(params) {
    return request({
      url: '/product/v31/api/zjbill/excel',
      method: "post",
      params,
      headers: {
        token: sessionStorage.getItem("token"),
      },
    });
  }
 /**
   * 通道管理
   */
  export function APIAccessControl(params) {
    return request({
      url: '/product/v31/api/channel/page',
      method: "get",
      params,
      headers: {
        token: sessionStorage.getItem("token"),
      },
    });
  }
 /**
   * 新增通道
   */
  export function APIAddAccess(params) {
    return request({
      url: '/product/v31/api/channel/save',
      method: "post",
      params,
      headers: {
        token: sessionStorage.getItem("token"),
      },
    });
  }
 /**
   * 获取通道详情
   */
  export function APIgetAccessDetail(id) {
    return request({
      url: `/product/v31/api/channel/get/${id}`,
      method: "get",
  
      headers: {
        token: sessionStorage.getItem("token"),
      },
    });
  }
 /**
   * 修改通道
   */
  export function APIupdateAccessDetail(id,params) {
    return request({
      url: `/product/v31/api/channel/update/${id}`,
      method: "put",
      params,
      headers: {
        token: sessionStorage.getItem("token"),
      },
    });
  }
 /**
   * 我的终端设置功能
   */
  export function APIsetUpTerminal(params) {
    return request({
      url: `/product/v31/api/terminal/updateOrSaveTerminalChannel`,
      method: "post",
      params,
      headers: {
        token: sessionStorage.getItem("token"),
      },
    });
  }
